package cn.lyvust.test;

import cn.lyvust.level.Permission;

/**
 * Description:Java四种访问修饰符
 * date: 2021-4-6 22:46
 *
 * @author Guo_guo
 * @since JDK 1.8
 */
public class PermissionDemo extends Permission {
    public static void main(String[] args) {
        // if is not a subclass, only public function and variable can be used
        Permission obj = new Permission();
        obj.publicFunc();
        System.out.println("this is a public value:" + obj.publicValue);

        // if is a subclass, public and protected function and variable can ba used
        PermissionDemo demo = new PermissionDemo();
        demo.publicFunc();
        demo.protectedFunc();
        System.out.println("this is a public value:" + demo.publicValue);
        System.out.println("this is a protected value:" + demo.protectedValue);
    }
}
